//
//  RCMerchantOrderDataModel.m
//  RocketProject
//
//  Created by Wu Chengwei on 13-11-11.
//  Copyright (c) 2013年 Rocket. All rights reserved.
//

#import "RCMerchantOrderDataModel.h"
#import "FrameworkRelativeDefines.h"

@implementation RCMerchantOrderDataModel
@synthesize orderServer = _orderServer;
@synthesize shopName = _shopName;
@synthesize typeArray = _typeArray;

-(id)init{
    self = [super init];
    if (self) {
        _orderServer = nil;
        _shopName = nil;
        _typeArray = nil;
    }
    return self;
}

-(void)dealloc{
    self.orderServer = nil;
    self.shopName = nil;
    self.typeArray = nil;
    [super dealloc];
}

+(id)parseDataFromJSON:(NSDictionary *)data{
    if (nil == data) {
        return nil;
    }
    NSDictionary *dict = [data dictionaryValueForKey:@"data" defaultValue:nil];
    if (nil == dict) {
        return nil;
    }
    
    RCMerchantOrderDataModel *retObject = nil;
    retObject = [[RCMerchantOrderDataModel alloc]init];
    if (nil == retObject) {
        return nil;
    }
    retObject.orderServer = [dict stringValueForKey:@"orderserve" defaultValue:nil operation:NSStringOperationTypeTrim];
    retObject.shopName = [dict stringValueForKey:@"shopname" defaultValue:nil operation:NSStringOperationTypeTrim];
    retObject.typeArray = [dict arrayValueForKey:@"items" defaultValue:nil];
    return [retObject autorelease];
}

@end
